package com.future.mayi.qsale.model;

import android.text.TextUtils;

import com.future.baselib.entity.BaseResponse;
import com.future.mayi.app.App;

import org.json.JSONException;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by Administrator on 2018/8/16.
 */

public class UploadMutilFileResponse extends BaseResponse {

    private UploadMutiFileModel uploadMutiFileModel;

    @Override
    public void parseInfo(String content) throws JSONException {
        uploadMutiFileModel = App.getGson().fromJson(content, UploadMutiFileModel.class);
    }

    public List<String> getResponseList() {
        String url = uploadMutiFileModel.getUrl();
        String[] splitUrl = url.split(",");
        List<String> urlList = new ArrayList<>(splitUrl.length);
        for (int i = 0; i < splitUrl.length; i++) {
            if (!TextUtils.isEmpty(splitUrl[i])) {
                urlList.add(splitUrl[i]);
            }
        }
        return urlList;
    }

    public String getResponseString() {
        return uploadMutiFileModel.getUrl();
    }

}
